package com.ushio.gougouwangguo.controller;

import com.ushio.commonmodule.pojo.result.Result;
import com.ushio.gougouwangguo.entity.mysql.MaterialsType;
import com.ushio.gougouwangguo.service.IMaterialsTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 物资类型表 前端控制器
 * </p>
 *
 * @author 张文凯
 * @since 2025-10-14
 */
@RestController
@RequestMapping("/materialsType")
public class MaterialsTypeController {

    @Autowired
    IMaterialsTypeService iMaterialsTypeService;
    @GetMapping("all")
    private Result<List<MaterialsType>> getMaterialsTypeAll(){
        try{
            List<MaterialsType> materialsTypeList =  iMaterialsTypeService.getMaterialsTypeAll();

            return Result.success(materialsTypeList);

        }catch (Exception e){
            e.printStackTrace();

            return Result.fail();

        }
    }



}
